<?php get_header(); ?>  
<div id="all_content">
	<?php get_sidebar(); ?>
	<div id="content_right">
		<div class="wrapper">
			<div class="all_content_news">
				<div id="title_detail_news"> <?php the_title()?> </div>
				<?php
					$post_thumbnail_id = get_post_thumbnail_id( get_the_ID() );
					$link_thumnail = wp_get_attachment_url ( $post_thumbnail_id );
					if ( empty ( $post_thumbnail_id ) ) {
						$link_thumnail =  get_bloginfo('template_url')."/images/default_avatar.jpg";
					}				
				?>
				<div class="avatar_detail_news"> 
					<a href="#"><img src="<?php echo $link_thumnail; ?>" width="205px" height="168px"></a> 
				</div>
				<strong style="color:#345C09; ">
					<div style="margin-bottom: 25px; text-align: justify; margin-right: 20px;"><?php the_excerpt(); ?> </div>
				</strong>
				<div class="short_text_detail_news news_block2">
					<div class="content" style="position:relative; z-index:9999">
						<?php
							the_content();
							?>
							
							<div id="tag_area" style="margin-top: 85px; margin-bottom: 25px;">
							Tags:
								<?php
									$tags = wp_get_post_tags ( get_the_ID() );
									$num_tags = count ( $tags );
									$count = 1;
									$output_str = "";
									foreach ( $tags as $tag ) {
										$output_str .= "<a href=\"".get_tag_link( $tag->term_id )."\">".$tag->name."</a>";
										if ( $count != $num_tags ) {
											$output_str .= ", ";
										}
										$count++;
									}
									echo $output_str;
								?>
							</div>
							
							
							<div class="border_gradient"></div>							
							
							<?php
							comments_template(); // enable facebook comment
						?>
						
					</div>
					<br />
					
					<div class="border_gradient"></div>
					<div class="otitle">Các tin khác</div>
					<?php
						$list_categories = get_the_category( $post->ID ) ;
						$currentParrentCategory = 0;
						foreach ( $list_categories as $category ) {
							if ( $category->slug != 'hot-news' ) {
								$currentParentCategory = $category->cat_ID ;
							}
						}
						$current_post_id = $post->ID;
						$args = array(
							'posts_per_page'   => 10,
							'offset'           => 0,
							'category'         => $currentParentCategory,
							'orderby'          => 'post_date',
							'order'            => 'DESC',
							'post_type'        => 'post'
						);
						$my_posts = get_posts( $args );
						foreach ( $my_posts as $post ) : setup_postdata( $post );
							if ( $current_post_id != $post->ID ) :
					?>					
							<div style="height:24px; z-index:99999; position:relative;">
								<a href="<?php the_permalink(); ?>" style="z-index:99999" class="a_link">» <?php the_title(); ?></a>
							</div>
						<?php
							endif;
						endforeach; 
						wp_reset_postdata();?>
					<br />
				</div>
			</div>
		</div>
		<!-- mousewheel plugin -->
		<script src="<?php bloginfo('template_url'); ?>/js/jquery-ui-1.9.1.custom.min.js"></script>
		<script src="<?php bloginfo('template_url'); ?>/js/jquery.mCustomScrollbar.js"></script>
		<script src="<?php bloginfo('template_url'); ?>/js/jquery.mousewheel.min.js"></script>
		
		<script>
			(function ($) {
				$(window).load(function () {
					$(".all_content_news").mCustomScrollbar({ set_height: 538 });
				});
			})(jQuery);
		</script>
	</div>
	<div style="clear: both"></div>
</div>	 
<?php get_footer(); ?>  